package org.xmonkey;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;

/**
 * The activator class controls the plug-in life cycle
 */
public final class XMonkey extends Plugin {

	// The plug-in ID
	public static final String PLUGIN_ID = "X_Monkey";

	// The shared instance
	private static XMonkey plugin;
	
	/**
	 * The constructor
	 */
	public XMonkey() {}

	public void start(BundleContext context) throws Exception {
		super.start(context);
		plugin = this;
	}

	public void stop(BundleContext context) throws Exception {
		plugin = null;
		super.stop(context);
	}

	public static XMonkey getDefault() {
		return plugin;
	}
	
	/**
	 * Standard Eclipse logging
	 * @param messageStatus the message and its status
	 */
	public static void log(IStatus messageStatus){
		plugin.getLog().log(messageStatus);;
	}

}
